Robotics 1.0
Lesson 13: Let's Follow - Line Tracking Rover

Purpose:Learn how to use IR sensors in the Rover to detect and navigate a guided path on its own

No. of. Classes

1 - 1 (Time : 1 hour and 30 minutes, each group has a maximum of 4 students).

Materials Required
  • CPX(Arduino board), Crickit and USB cable

  • Acrylic chassis kit

  • 2 IR sensors

  • Jumper wires

  • Rechargeable batteries

Prior knowledge

Students should already know how to connect and control DC motors through the Crickit and CPX. They should also know the basic movement of the rover using code and have an understanding of digital sensor signals.

Exercises

Exercise 1



Setting up the IR sensor


  • Connecting the IR sensors

    Click here to see the instructions on how to connect an IR sensor to Crickit and the working of an IR sensor


  • IR Sensor Working
  • Reading the values of an IR sensor

    Print the raw values of the IR sensors using the instructions and code in this document

    IR Sensor Working

    Exercise:2



    Build a line following Robot


  • Use two IR sensors placed on the left and right sides of the rover to detect and follow a path, made with black tape marking the rails on either side of the path and adjust the motor movement so the rover follows the path smoothly

    Use this pseudocode to design the logic and implement it in code using functions to read sensor values and control the motors.
  • Solution



  • Click here to view the solution video for Exercise 2.
  • Click here to view the code and the explanation for Exercise 2
  • Teacher's Instruction
    1. Introduce the IR sensor and explain its purpose in detecting obstacles.
    2. Show students how to connect the CPX and Crickit to a battery pack for powering the bot.
    3. Demonstrate the wiring of the IR sensor to the Crickit and CPX.
    4. Write a simple CircuitPython program to read values from the IR sensor and display them.
    5. Ask students to move their hand in front of the sensor to observe value changes.
    6. Teach students how to stop or turn the bot when the sensor detects an obstacle.
    7. Discuss real-life applications of obstacle detection (e.g., autonomous cars, cleaning robots).
    8. Conclude by highlighting that sensors give input signals and motors act as output devices.
    9. What do you think will happen if we use a tape of a different color instead of black, and will the IR sensor still be able to detect it correctly?